﻿@model IEnumerable<CadCon.Models.Empresa>

@{
    ViewBag.Title = "ListarEmpresas";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<div class="box">
<h2>
    <a id="toggle-tables" href="#">Lista de Empresas</a>
</h2>
<div id="tables" class="block">
<table summary="Listagem de Empresas do Cadastro de Consumidores">
	<caption>@Html.ActionLink("Nova Empresa", "Create")</caption>
	<thead>
		<tr>
			<th class="table-head" colspan="8">Cabeçalho</th>
		</tr>
		<tr>
        <th>Nome</th>
        <th>Cnpj</th>
        <th>Nome Fantasia</th>
        <th>Ramo</th>
        <th>Tel Sac</th>
        <th>Tel Sac 2</th>
        <th>Tel Sac 3</th>
        <th></th>
		</tr>
	</thead>	
	<tbody>
		@foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Nome)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Cnpj)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.NomeFantasia)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ramo.Nome)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.TelSac1)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.TelSac2)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.TelSac3)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id=item.IdEmpresa }) |
                @Html.ActionLink("Details", "Details", new { id=item.IdEmpresa }) |
                @Html.ActionLink("Delete", "Delete", new { id=item.IdEmpresa })
            </td>
        </tr>
      }
	</tbody>
</table>
</div>
</div>

